package operation;

import book.Book;
import book.BookList;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 */
public class ShowOperation implements IOperation{
    @Override
    public void work(BookList bookList) {
        System.out.println("显示图书");
        //获取书架里已有书的个数
        int count = bookList.getUseSize();
        for (int i = 0; i < count; i++) {
            //将方法返回的 Book对象引用存储到变量 book中。
            Book book = bookList.getBooks(i);//比如i=1， Book book =  new Book("红楼梦","曹雪芹",50,"小说");
            System.out.println(book);
        }
    }
}
